<%-- 
    Document   : addPayType
    Created on : 13-08-2014, 22:30:40
    Author     : NGOCLINH-PC
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="Data.PayType"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<div class="tablemember">
    <form action="../PayTypePR" method="post" name="formmember">
        <h2 style="padding: 10px; color: #999;">Management PayType</h2>
        <hr />
        <table width="100%" border="0" align="center" cellpadding="14" cellspacing="14">

            <%
                if (request.getParameter("EpayID") != null) {
                    PayType ct = new PayType();
                    int payID = Integer.parseInt(request.getParameter("EpayID"));
                    ArrayList<PayType> a = ct.PselectById(payID);
                    if (a.size() > 0) {
                        for (int i = 0; i < a.size(); i++) {
                            PayType pay = a.get(i);
            %>
            <tr>
                <td width='10%'>PayID</td>
                <td width='50%'><label for='txtcateid'></label>
                    <% out.print("<input type='text' readonly name='txtcateid' id='txtcateid' value='" + pay.getPayID() + "' /></td>");%>
            </tr>

            <tr>
                <td width="10%">PayType Name:</td>
                <td width="57%"><label for="txtdanhmuc"></label>
                    <% out.print("<input type='text' name='txtdanhmuc' required id='txtdanhmuc' value='" + pay.getPayName() + "'/></td>");%>
            </tr>

            <tr>
                <td>Status:</td>
                <%
                    if (pay.getStatus() == 1) {
                        out.print("<td><input type='radio' name='radio1' id='rdtrangthai' value='1' checked />");
                        out.print(" Show ");
                        out.print("<input type='radio' name='radio1' id='rdtrangthai' value='0' />");
                        out.print("Hidden</td>");
                    } else {
                        out.print("<td><input type='radio' name='radio1' id='rdtrangthai' value='1' />");
                        out.print(" Show ");
                        out.print("<input type='radio' name='radio1' id='rdtrangthai' value='0' checked />");
                        out.print("Hidden</td>");
                    }
                %>
            </tr>
            <tr align="">
                 <td></td>
                <td><input type="submit" name="btnsubmit" id="btnsubmit" value="Submit" />
                </td>
            </tr>
            <%
                    }
                }
            } else {
            %>
            <tr>
                <td width="10%">PayType Name:</td>
                <td width="57%"><label for="txtdanhmuc"></label>
                    <input type="text" name="txtdanhmuc" required id="txtdanhmuc" value=""/></td>
            </tr>

            <tr>
                <td>Status:</td>
                <td><input type="radio" name="radio1" id="rdtrangthai" value="1" checked />
                    Show 
                    <input type="radio" name="radio1" id="rdtrangthai" value="0"  checked />
                    Hidden</td>
            </tr>
            <tr >
                <td></td>
                <td ><input type="submit" name="btnsubmit" id="btnsubmit" value="Submit" />
                </td>
            </tr>

            <% }%>         

        </table>

    </form>
</div>
